//
//  TKIMLocationHelper.h
//  TKIM
//  定位帮助类
//  Created by liupm on 15/10/27.
//  Copyright © 2015年 liupm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>

@protocol TKIMLocationDelegate;

@interface TKIMLocationHelper : NSObject

@property(nonatomic,weak) id<TKIMLocationDelegate> delegate;

/**
 *  @Author lpm, 15-10-27 10:10:50
 *
 *  @brief  获得地图视图
 *
 *  @param frame 大小
 *
 *  @return 
 */
-(MKMapView *)getMapView:(CGRect)frame;


/**
 *  @Author lpm, 15-10-27 10:10:49
 *
 *  @brief  开始定位自身位置
 */
-(void)startLocation;


/**
 *  @Author lpm, 15-10-27 13:10:37
 *
 *  @brief  放置地理标注
 *
 *  @param latitude
 *  @param longitude
 *  @param title
 */
- (void)addAnnotation:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude title:(NSString *)title;


@end


/**
 *  @Author lpm, 15-10-27 13:10:49
 *
 *  @brief  位置代理
 */
@protocol TKIMLocationDelegate <NSObject>


/**
 *  @Author lpm, 15-10-27 13:10:44
 *
 *  @brief  定位到用户的地理位置
 *
 *  @param userLocation
 */
-(void)didReceiveUserLocation:(NSMutableDictionary *)userLocation;


/**
 *  @Author lpm, 15-10-27 13:10:54
 *
 *  @brief  定位用户地理位置失败
 *
 *  @param error
 */
-(void)didFailToLocateUserWithError:(NSString *)errorInfo;


@end


/**
 *  @Author lpm, 15-10-27 13:10:34
 *
 *  @brief  自定义的标注
 */
@interface MyPoint : NSObject <MKAnnotation>

//实现MKAnnotation协议必须要定义这个属性
@property (nonatomic,readonly) CLLocationCoordinate2D coordinate;
//标题
@property (nonatomic,copy) NSString *title;

//自定义大头针图片
@property(nonatomic,copy) NSString *icon;

//初始化方法
-(id)initWithCoordinate:(CLLocationCoordinate2D)c andTitle:(NSString*)t;

@end